package ar.dvorakes.generator;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class GUIBINUnitsContainerFactory {

	public static void main(String[] args) {
		String[] a = "abc".split("");
		System.out.println("lala");
	}

	public static GUIBINUnitsContainer buildUnitsContainer(String characters,
			int unitLenght) {
		List<String> values = new ArrayList<String>();
		generateValues(values, characters, unitLenght);
		List<GUIBINUnit> units = new ArrayList<GUIBINUnit>();
		for (String value : values) {
			units.add(new GUIBINUnit(value));
		}
		return new GUIBINUnitsContainer(units);
	}

	private static void generateValues(List<String> values, String characters,
			int unitLenght) {
		List<String> aux = Arrays.asList(characters.split(""));
		aux.remove(0);
		addLevel(values, aux, unitLenght, unitLenght);
	}

	private static void addLevel(List<String> values, List<String> characters,
			int unitLenght, int i) {
		if (i == 1) {
			values.addAll(characters);
			
		}

	}
}
